package com.iceclean.po;

/**
 * @author : Ice'Clean
 * @date : 2021-05-03
 *
 * 贴子评论实体类
 */
public class PostComment {
    /**
     * 分别表示：
     * 贴子 id
     * 用户 id
     * 评论 id
     * 评论的根评论 id（为 null 则该评论为根评论，不为 null 则该评论为子评论）
     * 评论的子评论数量
     * 评论内容
     * 评论所在贴子的楼层（只有根评论才会有楼层）
     * 评论的创建日期
     */
    private Integer postId;
    private Integer userId;
    private Integer commentId;
    private Integer rootCommentId;
    private Integer commentReply;
    private String commentContent;
    private Integer commentFloor;
    private String createDate;


    public PostComment() {
        this.commentReply = 0;
    }

    /**
     * 这里创建的是根评论，因为给出了楼层
     * @param postId 评论所属贴子 id
     * @param userId 评论发布者 id
     * @param commentContent 评论内容
     * @param commentFloor 评论所处楼层
     */
    public PostComment(Integer postId, Integer userId, String commentContent, Integer commentFloor) {
        this.postId = postId;
        this.userId = userId;
        this.commentContent = commentContent;
        this.commentFloor = commentFloor;
        this.commentReply = 0;
    }

    /**
     * 这里创建的是子评论，因为给出了根评论 id
     * @param postId 评论所属贴子 id
     * @param userId 评论发布者 id
     * @param rootCommentId 评论的根评论 id
     * @param commentContent 评论内容
     */
    public PostComment(Integer postId, Integer userId, Integer rootCommentId, String commentContent) {
        this.postId = postId;
        this.userId = userId;
        this.commentContent = commentContent;
        this.rootCommentId = rootCommentId;
        this.commentReply = 0;
    }

    public void setPostId(Integer postId) {
        this.postId = postId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public void setCommentId(Integer commentId) {
        this.commentId = commentId;
    }

    public void setRootCommentId(Integer rootCommentId) {
        this.rootCommentId = rootCommentId;
    }

    public void setCommentReply(Integer commentReply) {
        this.commentReply = commentReply;
    }

    public void setCommentContent(String commentContent) {
        this.commentContent = commentContent;
    }

    public void setCommentFloor(Integer commentFloor) {
        this.commentFloor = commentFloor;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public Integer getPostId() {
        return postId;
    }

    public Integer getUserId() {
        return userId;
    }

    public Integer getCommentId() {
        return commentId;
    }

    public Integer getRootCommentId() {
        return rootCommentId;
    }

    public Integer getCommentReply() {
        return commentReply;
    }

    public String getCommentContent() {
        return commentContent;
    }

    public Integer getCommentFloor() {
        return commentFloor;
    }

    public String getCreateDate() {
        return createDate;
    }

    @Override
    public String toString() {
        return "PostComment{" +
                "postId=" + postId +
                ", userId=" + userId +
                ", commentId=" + commentId +
                ", rootCommentId=" + rootCommentId +
                ", commentReply=" + commentReply +
                ", commentContent='" + commentContent + '\'' +
                ", commentFloor=" + commentFloor +
                ", createDate='" + createDate + '\'' +
                '}';
    }
}
